﻿app.controller('EnviromentController', function ($scope, $http, $window, $compile, $filter, ipCookie, common, option, Upload, $interval) {
    $scope.result = {};
    $scope.dateOption = option.date;
    $scope.datetimeOption = option.datetime;

    $scope.InitData = function () {
        $scope.DataModel = {};
        $scope.DataModel.Temp = (Math.random() * (27 - 26) + 26).toFixed(2);
        $scope.DataModel.Hum = Math.floor(Math.random() * (66 - 63 + 1)) + 63;

        var intervalPromise = $interval(function () {
            $scope.DataModel.Temp = (Math.random() * (27 - 26) + 26).toFixed(2);
            $scope.DataModel.Hum = Math.floor(Math.random() * (66 - 63 + 1)) + 63;
        }, 60000);
    }
});